// 1. mehtod dyn Error
use std::fs::{File,read_to_string};
use std::error::Error;

fn main() -> Result<(), Box<dyn Error>> {
    // println!("Hello, world!");

    let html = render()?;
    println!("{}", html);
    Ok(())
}

fn render() -> Result<String, Box<dyn Error>> {
    //println!("1");
    // get environment varible 
    let f = std::env::var("MARKDOWN")?;
    // println!("{f}");
    let source = read_to_string(f)?;

    Ok(source)
}